#@adminLayout()
#define main()
<div class="jbolt_page" data-key="#(pmkey)"  >
    <div class="jbolt_page_title">
        <div class="row">
            <div class="col-4">
                <h1>商家管理</h1>
                <span> #(pageData.totalRow?? 0) 条记录</span>
            </div>
            <div class="col-5">
                <form class="form-inline" id="becRetailerTypeForm" action="/auth/mall/retailer"  data-pjaxsubmit  method="get">
                    <input type="text" autocomplete="off"  class="form-control"  placeholder="输入关键字搜索" id="keywords" name="keywords" value="#(keywords??)" />
                    <select class="form-control "  data-url="/auth/mall/retailer/get_retailer_status" id="retailer_status" name="retailer_status" data-autoload  data-text="=选择商家状态=" data-value="" data-select="#(retailer_status??)">

                    <input type="hidden" name="delete_status" value="#(delete_status?? false)"/>
                    <button  onclick="normaMemberlData()" class="btn btn-light" ><i class="fa fa-search"></i> 查询</button>
                        <button  onclick="Testreset()"  data-handler="reloadCurrentPage"  class="btn btn-light"  ><i class="fa fa-refresh"></i> 重置</button>
                    <button  type="button" onclick="trashMemberData()" class="btn btn-#((delete_status?? && delete_status=='true')?'danger':'light')" ><i class="fa fa-trash"></i> 回收站(#(deleteCount?? 0))</button>

                </form>
            </div>
            <div class="col-3">
                <button data-area="800,500" data-handler="refreshPjaxContainer"   data-jboltlayertrigger  data-width="500"   data-noclose  data-confirm   data-title="新增" data-url="/auth/mall/retailer/add_basic" class="pull-right jbolt_table_addbtn btn btn-success" ><i class="fa fa-plus"></i> 新增</button>
            </div>
        </div>
    </div>
    <div class="jbolt_page_content">
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped table-center">
                <thead>
                <tr>
                    <th style="width: 60px">详情</th><th style="width: 100px">商家名称</th>
                    <th style="width: 60px">商家类别</th><th style="width: 100px">手机号</th>
                    <th style="width: 130px">地址</th><th style="width: 60px">状态</th>
                    <th style="width: 150px">营业执照</th><th style="width: 60px">会员折<br>扣(%)</th>
                    <th style="width: 30px">平台抽<br>成(%)</th><th style="width: 30px">分销商<br>积分比(%)</th>
                    <th style="width: 30px">充值金<br>额(元)</th><th style="width: 30px">充值赠<br>送(元)</th>
                    <th style="width: 100px">营业时间</th><th style="width: 120px">基本信息</th>
                </tr>
                </thead>
                <tbody>
                #if(pageData)
                #for(data:pageData.list)
                <tr>
                    <td><img src="assets/img/off.png" data-switchbtn  data-handler="toggleVisiable('#hidden_#(for.index+1)')"></td>
                    <td>#(data.name??)</td>
                    <td>#(MyUtil.get_retailer_type_name(data.type_id??))</td>
                    <td>#(data.mobile??)</td>
                    <td>#(data.address??)</td>
                    <td>#(MyUtil.get_retailer_status(data.status??))</td>
                    <td><img class="j_goodslist_mainimg" data-photobtn tooltip data-title="点击查看大图"  src="#realImage(data.license_image??,'/assets/img/uploadimg.png')"/></td>
                    <td>#(data.discount??)</td>
                    <td>#(data.platform_commission??)</td>
                    <td>#(data.spreader_credit??)</td>
                    <td>#(MyUtil.get_price_string(data.charge_amount??)??0.00)</td>
                    <td>#(MyUtil.get_price_string(data.charge_bonus??)??0.00)</td>
                    <td>#(MyUtil.get_date_daytime(data.open_time??))<br> - <br>#(MyUtil.get_date_daytime(data.close_time??))</td>
                    <td>
                        #if(data.status==0)
                        <a tooltip data-title="基本信息"  data-confirm  data-jboltlayertrigger   href="/auth/mall/retailer/modify_basic/#(data.id)"    data-width="500"   data-noclose><i class="fa fa-edit"> </i>基本信息</a>
                        <br>
                        <a tooltip  data-title="财务设置" data-confirm  data-jboltlayertrigger  href="/auth/mall/retailer/modify_finance/#(data.id)"   data-width="500"   data-noclose > <i class="fa fa-facebook"></i>财务设置</a>
                        <br>
                        <a tooltip data-title="营业执照"  data-confirm data-jboltlayertrigger href="/auth/mall/retailer/modify_license_image/#(data.id)"   data-width="500"   data-noclose><i class="fa fa-image"></i>营业执照</a>
                        <br>
                        <a tooltip  class=" jbolt_table_addbtn " style="color: #007bff" data-title="商家导航"  data-url="/auth/mall/retailer/modify_location/#(data.id)" data-handler="refreshPjaxContainer"   data-area="1200,700" data-scroll="yes"><i class="fa fa-location-arrow"></i>商家导航</a>
<!--                        <button data-area="800,500" data-scroll="yes" data-handler="refreshPjaxContainer" data-title="新增品牌" data-url="/auth/mall/retailer/modify_location/#(data.id)" class="pull-right jbolt_table_addbtn btn btn-success" >-->

                        <br>

                        <a tooltip data-title="删除"  href="/auth/mall/retailer/delete_retailer/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定删除此商家?" class="jbolt_table_delbtn"><i class="fa fa-remove"></i>删除</a>
                        #end
                        #if(data.status==2)
                        <a  tooltip  title="通过"  href="/auth/mall/retailer/pass_retailer/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定通过此商家请求?" class="jbolt_table_delbtn"> <i class="fa fa-check mr-2 c-danger"></i></a>
                        <a  tooltip  title="拒绝/驳回"  href="/auth/mall/retailer/turn_down_retailer/#(data.id)" data-handler="refreshPjaxContainer"  data-confirm="确定驳回此商家请求?" class="jbolt_table_delbtn"> <i class="fa fa-remove c-danger"></i> </a>
                        #end
                        #if(data.status==1)
                        <a  tooltip  title="还原"  href="/auth/mall/retailer/restore_retailer/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定恢复此商家？(恢复后的商家状态转为待审核)" class="jbolt_table_delbtn"><i class="fa fa-mail-reply c-danger"></i></a>
                        #end
                    </td>
                </tr>
                <tr>
                    <td colspan="15" style="display: none" id="hidden_#(for.index+1)">
                        <div class="row">
                            <div class="col-4">
                                <li >管理员ID:#(data.admin??)</li>
                                <li >营业执照ID:#(data.license_id??)</li>
                                <li >余额:#(data.balance??)</li>
                            </div>
                            <div class="col-4">
                                <li >加入时间:#(MyUtil.get_date(data.join_time??))</li>
                                <li >更新时间:#(data.update_time??)</li>
                                <li >优惠过期时间:#(MyUtil.get_date(data.expired??)??) </li>
                            </div>

                            <div class="col-4">
                                <li >经营范围:#(data.license_range??)</li>
                                <li >经度:#(data.latitude??)</li>
                                <li >纬度:#(data.longtitude??)</li>
                            </div>

                        </div>
                    </td>
                </tr>

                #end
                #end
                </tbody>
            </table>
        </div>
        #include("/_view/_admin/common/_page.html",pageEleId="retailerTypePageIndex")
    </div>
</div>
</div>
</div>
#end
#define js()
<script>

    $(function(){
        initPage("retailerTypePageIndex",#(pageData.totalPage??),#(pageData.pageNumber??),"becRetailerTypeForm");
    });

    //测试可刷新 -- 提交表单
    function RefreshsubmitForm(formEId){
        var form=getRealJqueryObject(formEId);
        if(FormChecker.check(form)){

            var url=form.action;
            form.ajaxSubmit({
                type:"post",
                url:url,
                success:function(ret) {
                    if (ret.state == "ok") {
                            LayerMsgBox.success(ret.msg, 500,function () {
                                refreshPjaxContainer();
                            });

                    } else {
                        LayerMsgBox.alert(ret.msg, 2);
                    }
                }
            });
        }
        return false;
    }

    function Testreset() {
        document.getElementById("keywords").value = "";
        document.getElementById("retailer_status").value = "";
        document.getElementById("delete_status").value = "";

    }



    var retailerFormIndex=$("#becRetailerTypeForm");

    /**
     * 普通查询
     */
    function normaMemberlData(){
        retailerFormIndex.find("[name='delete_status']").val(false);
        retailerFormIndex.submit();
    }

    /**
     * 查回收站
     */
    function trashMemberData(){
        retailerFormIndex.find("[name='delete_status']").val(true);
        retailerFormIndex.submit();
    }

</script>

#end

